// 引入封装好的aixos
import request from '@/utils/request.js';
// 引入封装的轮播方法
import requestMock from '@/utils/requestMock';
// 发请求获取菜单栏数据
export let reqgetlist = () => {
  return request.get('/api/product/getBaseCategoryList')
}
// 发送请求获取轮播数据
export let reqBanner = () => {
  return requestMock.get('/banner')
}

// 发送请求获取楼层数据
export let reqFloor = () => {
  return requestMock.get('/floor')
}

// 发送请求获取商品分类数据
export let reqGetSearch = (val) => {
  return request.post('/api/list', val)
}

// 发送请求获取商品详情数据
export let reqGetDetail = (skuId) => {
  return request({ url: `/api/item/${skuId}`})
}

// 添加到购物车 |  对购物车进行改动
export const reqAddOrChangeCart = (skuId,skuNum) => {
  return request({ url: `/api/cart/addToCart/${skuId}/${skuNum}`, method:'post' })
}

// 获取购物车列表
export const reqCartList = ()=>{
  return request({url:`/api/cart/cartList`})
}

// 添加商品数量
export const reqAddCart =(data)=>{
  return request({url:`/api/cart/addToCart/${ data.skuId }/${ data.skuNum }`,method:'POST'})
}